﻿/*******************************************************************************
 * Copyright © 2016 DJY 版权所有
 * Author: DJY
 * Description: 后台管理系统
 * Website：http://www.djyweb.cn
*********************************************************************************/

using DJY.Code;
using DJY.Code.Helper;
using DJY.Domain.ViewModel;
using DJY.Code.Enums;
using DJY.Domain.Entity.SystemManage;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System;
using DJY.Service.SystemManage;
using DJY.Domain.ViewModel.SystemManage;

namespace DJY.Web.Areas.SystemManage.Controllers
{
    public class UserController : ControllerBase
    {
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetClientsDataJson()
        {
            return Json(OperatorProvider.Resolve<ISysUserService>()
                .GetClientData(OperatorProvider.GetCurrent().UserId),
                JsonRequestBehavior.AllowGet);
        }

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        public JsonResult SelectUserPageList(HtmlSelectQueryInfo queryInfo)
        {
            OperatorModel user = OperatorProvider.GetCurrent();
            queryInfo.userId = user.UserId;
            return Json(OperatorProvider.Resolve<ISysUserService>().SelectUserPageList(queryInfo), 
                JsonRequestBehavior.AllowGet);
        }
    }
}
